/*
 * $Id: RC4.cc,v 1.1 2005-05-02 11:14:47 bacon Exp $
 */

#include <xpp/bas/RC4.h>

namespace xpp 
{
	namespace bas
	{

		RC4::RC4 ()
		{
			xp_rc4_open (this);
		}

		RC4::~RC4 ()
		{
			xp_rc4_close (this);
		}

		RC4::RC4 (const xp_byte_t* pw, xp_size_t psz) 
		{
			xp_rc4_open (this);
			setPasswd (pw, psz);
		}
		
		void RC4::setPasswd (const xp_byte_t* pw, xp_size_t psz)
		{
			xp_rc4_set_passwd (this, pw, psz);
		}
		
		void RC4::restart ()
		{
			xp_rc4_restart (this);
		}
		
		xp_byte_t RC4::cipher (xp_byte_t c) 
		{
			return xp_rc4_cipher (this, c);
		}
		
	}
}
